<?php
include_once($_SERVER['DOCUMENT_ROOT']."/RecJP/inc/usedb_inc.php");
include_once($_SERVER['DOCUMENT_ROOT']."/RecJP/inc/smarty_inc.php");
include_once($_SERVER['DOCUMENT_ROOT']."/RecJP/class/DAL/DAL.LessonOperator.php");

$LessonResult=DAL_lessonOperator::GetLessonList();
foreach ($LessonResult as $key => $value) {
            if ($value["bookid"] == 1) {
                $xinbian1[] = $value["lesson"];
            } else if ($value["bookid"] == 2) {
                $xinbian2[] = $value["lesson"];
            } else if ($value["bookid"] == 3) {
                $dajia[] = $value["lesson"];
            }
        }
        $smarty=getSmarty();
        $smarty->assign("xinbian1", $xinbian1);
        $smarty->assign("xinbian2", $xinbian2);
        $smarty->assign("dajia", $dajia);
        


if(isset($_GET['l']))
{
	$sql="SELECT * FROM TextTable where bookid=1 and lesson=".$_GET['l'];
}
else
{
	$sql="SELECT * FROM TextTable where lesson=1 and bookid=1";
}
$result=  getSqliteHelper()->Query($sql,null);
//print_r($result);
$smarty->assign("Text", $result);
$smarty->display('Text.tpl.htm');
